package com.yzc.android.beans;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by yzc on 16/5/21.
 */
public class MotionDeltaBean implements Parcelable {
    public double accelerationDelta;
    public double yawDelta;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeDouble(this.accelerationDelta);
        dest.writeDouble(this.yawDelta);
    }

    public MotionDeltaBean(double acceleration, double yaw) {
        this.accelerationDelta = acceleration;
        this.yawDelta = yaw;
    }

    protected MotionDeltaBean(Parcel in) {
        this.accelerationDelta = in.readDouble();
        this.yawDelta = in.readDouble();
    }

    public static final Parcelable.Creator<MotionDeltaBean> CREATOR = new Parcelable.Creator<MotionDeltaBean>() {
        @Override
        public MotionDeltaBean createFromParcel(Parcel source) {
            return new MotionDeltaBean(source);
        }

        @Override
        public MotionDeltaBean[] newArray(int size) {
            return new MotionDeltaBean[size];
        }
    };
}
